﻿package mortal.game.scene3D.model.data
{
    import Message.Game.*;
    import flash.utils.*;

    public class FightData extends Object
    {
        private static var bFAttackIdList:Array = new Array();
        private static var dicBFIdDF:Dictionary = new Dictionary();

        public function FightData()
        {
            return;
        }// end function

        public static function addBeginFight(param1:int) : void
        {
            if (!isInBeginFight(param1))
            {
                bFAttackIdList.push(param1);
            }
            return;
        }// end function

        public static function removeBeginFight(param1:int) : void
        {
            if (isInBeginFight(param1))
            {
                delete dicBFIdDF[param1];
                bFAttackIdList.splice(bFAttackIdList.indexOf(param1), 1);
            }
            return;
        }// end function

        public static function isInBeginFight(param1:int) : Boolean
        {
            return bFAttackIdList.indexOf(param1) >= 0;
        }// end function

        public static function addDoFight(param1:SDoFight) : Boolean
        {
            if (isInBeginFight(param1.attackId))
            {
                if (dicBFIdDF.hasOwnProperty(param1.attackId))
                {
                    (dicBFIdDF[param1.attackId] as Array).push(param1);
                }
                else
                {
                    dicBFIdDF[param1.attackId] = [param1];
                }
                return true;
            }
            else
            {
                return false;
            }
        }// end function

        public static function getDoFight(param1:int) : Array
        {
            return dicBFIdDF[param1] as Array;
        }// end function

        public static function clear() : void
        {
            bFAttackIdList = new Array();
            dicBFIdDF = new Dictionary();
            return;
        }// end function

    }
}
